package day1;
//父类
public class Person {
    private String name;
    private Integer age;
    private String job;

    //说话
    public void speak(){
        System.out.println("i am human");
    }
    //计算 重载部分
    //加法
    public void calculate(Integer num1,Integer num2){
        Integer res = num1 + num2;
        System.out.println("两数之和为:"+res);
    }
    //乘法
    public void calculate(double num1,double num2,double num3){
        double res = num1 + num2 + num3;
        System.out.println("三数之和为:"+res);
    }


    public Person() {
    }

    public Person(String name, Integer age, String job) {
        this.name = name;
        this.age = age;
        this.job = job;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", job='" + job + '\'' +
                '}';
    }
}
